/*
* 常量数据
*/

export const REQUEST_SUCCESS = '200';

export const REQUEST_UNAUTHORIZED = '403';

export const VALIDATOR_FAIL_TIP = '校验不通过，请重新输入！';

export const EMPTY_STR = '';

export const OPERATION_SUCCESS_TIP = '操作成功';

export const DELETE_SUCCESS_TIP = '删除成功';

export const AUTO_DISAPPEAR_TIME = 1;

export const ERROR_DISAPPEAR_TIME = 2;

export const IDMAINDATA = ['checkinterval', 'fluxinterval', 'infosvr', 'statesvr', 
    'denytimerange', 'tasksetting', 'sendinfo', 'querycount' ];

export const FUNDATA = [ 'checkinterval', 'denytimerange', 'dreg', 'fluxinterval', 'maxspeed',
    'infosvr', 'internal', 'param', 'sendinfo', 'statesvr', 'tasksetting', 'wreg', 'wxml', 'wini',
    'wtempstatus', 'wpslink' ];

export const OPTIONDATA = [
        {
            title: '请选择',
            value: '',
            url: ''
        }, {
            title: '设置信息',
            value: 'set',
            url: '/app/upgrade/version/settingsItem/',
            permission:'settingitem:all'
        }, {
            title: '客户端信息',
            value: 'client',
            url: '/app/upgrade/version/clientInfo/',
            permission:'client:all'
        }, {
            title: '泡泡信息',
            value: 'popup',
            url: '/app/upgrade/version/popupInfo/',
            permission:'popup:all'
        }, {
            title: '升级包信息',
            value: 'patch',
            url: '/app/upgrade/version/patchInfo/',
            permission:'patch:all'
        }, {
            title: '动作信息',
            value: 'actions',
            url: '/app/upgrade/version/actions/',
            permission:'action:all'
        } 
    ];

export const DETAILOPTIONDATA = [
        {
            title: '设置信息',
            value: 'set',
            url: '/app/upgrade/version/settingsItem/',
            permission:'settingitem:all'
        }, {
            title: '客户端信息',
            value: 'client',
            url: '/app/upgrade/version/clientInfo/',
            permission:'client:all'
        }, {
            title: '泡泡信息',
            value: 'popup',
            url: '/app/upgrade/version/popupInfo/',
            permission:'popup:all'
        }, {
            title: '升级包信息',
            value: 'patch',
            url: '/app/upgrade/version/patchInfo/',
            permission:'patch:all'
        }, {
            title: '动作信息',
            value: 'actions',
            url: '/app/upgrade/version/actions/',
            permission:'action:all'
        } 
    ];
export const CHARTSTATUS = [
        {
            title: '自更新',
            value: 'SELFMODE',
        }, {
            title: '增量升级',
            value: 'DIFFMODE',
        }, {
            title: '全包升级',
            value: 'BIGMODE',
        }, {
            title: '其它升级方式',
            value: 'NORMALMODE',
        }, {
            title: '没有新的升级版本',
            value: 'NOUPDATE',
        }, {
            title: '客户端关闭升级',
            value: 'CLOSEUPDATETIP',
        }, {
            title: '流量检查不通过',
            value: 'BUSY',
        }, {
            title: '状态筛选失败（人数、IP）',
            value: 'FILTERFAIL',
        }, {
            title: '第一次升级请求',
            value: 'GETFIRSTINFO',
        }, {
            title: '第二次升级请求',
            value: 'GETSECONDINFO',
        }, {
            title: '请求错误',
            value: 'ERROR',
        }, {
            title: '流量维持',
            value: 'FLUXKEEP',
        }  
    ];

//版本类型
export const VERTYPE = [
    {
        title: '专业版',
        value: 'Pro',
    }, {
        title: '专业增强版(带VBA)',
        value: 'ProEx',
    }, {
        title: '家庭版',
        value: 'Home',
    }, {
        title: '个人版',
        value: 'Personal',
    }, {
        title: '开发版',
        value: 'Dev',
    }, {
        title: 'OEM版',
        value: 'OEM',
    }, {
        title: '教育版',
        value: 'Edu',
    }
];

//按钮样式
export const BUTTONLAYOUT = {
    xs: 24,
    sm: 6,
    md: 4,
    lg: 3,
    xl: 2
};

//分页默认一页显示数目
export const DEFAULT_PAGE = 0;
export const DEFAULT_PAGE_SIZE = 50;

export const FMT_SECOND = 'YYYY-MM-DD HH:mm:ss';
export const FMT_MONTH = 'YYYY-MM';

export const BUTTONSPAN = {
    xs: 24,
    sm: 7,
    md: 6,
    lg: 5,
    xl: 3,
}

export const STATISTICS_NO_PERMISSION = '无权限查看,请联系管理员!';

export const STATISTIC_BAR_WIDTH = 20;

export const STATISTIC_LINE_WIDTH = 18;

/*  Echarts 配合相关*/

export const  AXIS_LABEL = {
    interval: 0,//横轴信息显示设置,0表示显示所有标签,1表示隔一个显示,以此类推
    rotate: -13,//-30度角倾斜显示
    formatter:(value)=>{
        const length = 4;
        if(value.length > length){
            return value.substring(0, length)+'...';
        }
        return value;
    }
};

export const dataZoom = (yData) => {
    return [
        {
            type: 'slider',
            show: true,
            start: 0,
            end: yData.length >= 10 ? 1000/yData.length : 100,
            handleSize: 10,
            maxSpan:(yData.length >= 10 ? 1000/yData.length : 100)*1.3,
            bottom: 3,
            fillerColor:'rgba(167,183,204,0.5)',
            dataBackground:{
                areaStyle:{
                    color:'rgba(47,69,84,0.1) '
                }
            }
        },
        {
            type: 'inside',
            start: 0,
            end: 12,
        }
    ];
}

export const LABEL_NORMAL = {
    show: true,
    position: 'top',
    // offset: [11, 0]
}